import { request } from "@/utils/request";
const UserApiPaths = {
  Login: "/user/login",
  Update: "/user/update",
  Details: "/user/details",
  UpdatePassword: "/user/update-password",
  Find: "/user/find"
};

export function userLogin(data: DTO.User.LoginParams) {
  return request<DTO.User.LoginResult, DTO.User.LoginParams>({
    url: UserApiPaths.Login,
    data
  });
}

export function userUpdate(data: DTO.User.UpdateParams) {
  return request({
    url: UserApiPaths.Update,
    data
  });
}

export function userDetails() {
  return request({
    url: UserApiPaths.Details
  });
}

export function userUpdatePassword(data: DTO.User.UpdatePasswordParams) {
  return request({
    url: UserApiPaths.UpdatePassword,
    data
  });
}

export function userFind(data: DTO.User.FindParams) {
  return request<ListResponseResult<DTO.User.FindResult>, DTO.User.FindParams>({
    url: UserApiPaths.Find,
    data
  });
}
